
#if	!defined( __20081116_DEF_IP_H__ )
#define	__20081116_DEF_IP_H__

namespace PCE_Lib {
namespace CEnv_Def {
namespace PCE_Lib_CurrentCEnvironment {
namespace Tools {

class IP : public Protocol
{
public:
	typedef	Protocol	inherited;
public:
	virtual bool Open( const char_t * addr, uint16_t port, bool is_syn = true ) throw() = 0;
	virtual bool Close( void ) throw() = 0;
	virtual SyncConnection * GetSyncConnection( void ) throw() = 0;
	virtual AsyncConnection * GetAsyncConnection( void ) throw() = 0;
protected:
	IP( void ) throw() : inherited() {}
public:
	virtual ~IP( void ) throw() {}
};

class IPv4 : public IP
{
public:
	typedef	IP	inherited;
public:
	virtual bool Open( uint32_t addr, uint16_t port, bool is_syn = true ) throw() = 0;
protected:
	IPv4( void ) throw() : inherited() {}
public:
	virtual ~IPv4( void ) throw() {}
};

}	// Tools
}	// PCE_Lib_CurrentCEnvironment
}	// CEnv_Def
}	// PCE_Lib

#if	defined( PCE_CFG_OS_Windows )

	#include	"WinSockIPv4.h"

	namespace PCE_Lib {
	namespace CEnv_Def {
	namespace PCE_Lib_CurrentCEnvironment {
	namespace Tools {

		typedef	WinSockIPv4Client	IPv4Client;
		typedef	WinSockIPv4Server	IPv4Server;

	}	// Tools
	}	// PCE_Lib_CurrentCEnvironment
	}	// CEnv_Def
	}	// PCE_Lib

#elif defined( PCE_CFG_OS_Linux )

	#include	"LinuxIPv4.h"

	namespace PCE_Lib {
	namespace CEnv_Def {
	namespace PCE_Lib_CurrentCEnvironment {
	namespace Tools {

		typedef	LinuxIPv4Client	IPv4Client;
		typedef	LinuxIPv4Server	IPv4Server;

	}	// Tools
	}	// PCE_Lib_CurrentCEnvironment
	}	// CEnv_Def
	}	// PCE_Lib

#else
	#error	Not define or unrecognized PCE_CFG_OS_XXX
#endif

#endif	// __20081116_DEF_IP_H__
